import Vue from 'vue'
import VueRouter from 'vue-router'
const index = () => import("@/views/Index.vue");
const error = () => import("@/views/404.vue"); 
const login = () => import("@/views/login.vue"); 
const loginnext = () => import("@/views/loginnext.vue"); 
const sinUp = () => import("@/views/sinUp.vue"); 
const introduce = () => import("@/views/introduce.vue");
const contact = () => import("@/views/contact.vue");
const detail = () => import("@/views/detail.vue");
const search = () => import("@/views/search.vue");
const person = () => import("@/views/person.vue");
const forgetPass = () => import("@/views/forgetPass.vue");

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },{
    path: '/index',
    component: index
  },{
    path: '/login',
    component: login
  },{
    path: '/loginnext',
    component: loginnext
  },{
    path: '/sinUp',
    component: sinUp
  },{
    path: '/introduce',
    component: introduce
  },{
    path: '/contact',
    component: contact
  },{
    path: '/detail',
    component: detail,
    meta: {keepAlive: true}
  },{
    path: '/search',
    component: search
  },{
    path: '/person',
    component: person
  },{
    path: '/forgetPass',
    component: forgetPass
  },{
    path: '/error',
    component: error,
    meta: {
      title: '页面走丢了'
    }
  }
]

const router = new VueRouter({
  // mode: 'history',
  routes,
  linkActiveClass: 'active'
})

export default router
